<?php
/**
 * Created by PhpStorm.
 * User: sunzexin
 * Date: 2018/1/28
 * Time: 11:33
 */

namespace App\Http\Traits;


use Illuminate\Http\Request;

trait WechatArticleTrait
{
    use BaseTrait;

    // 文章名称
    protected $article_title;
    // 文章作者
    protected $article_author;
    // 微信号
    protected $weixin_name;
    // 微信公众号名称
    protected $weixin_nickname;
    // 发布时间
    protected $article_publish_time;
    // 文章封面图
    protected $article_thumbnail;
    // 文章概述
    protected $article_brief;
    // 文章内容
    protected $article_content;
    // 是否原创
    protected $is_original;
    // 公众号头像
    protected $weixin_avatar;
    // 公众号介绍
    protected $weixin_introduce;
    // 公众号二维码图片
    protected $weixin_qr_code;
    // 内容页图片列表
    protected $article_images;
    // 文章顺序
    protected $idx;

    // 分页大小
    protected $limit;

    public function __construct(Request $request)
    {
        $this->article_title = $request->input('article_title', '');
        $this->article_author = $request->input('article_author', '');
        $this->weixin_name = $request->input('weixin_name', '');
        $this->weixin_nickname = $request->input('weixin_nickname', '');
        $this->article_publish_time = $request->input('article_publish_time', '');
        $this->article_thumbnail = $request->input('article_thumbnail', '');
        $this->article_brief = $request->input('article_brief', '');
        $this->article_content = $request->input('article_content', '');
        $this->is_original = $request->input('is_original', 0);
        $this->weixin_avatar = $request->input('weixin_avatar', '');
        $this->weixin_introduce = $request->input('weixin_introduce', '');
        $this->weixin_qr_code = $request->input('weixin_qr_code', '');
        $this->article_images = $request->input('article_images', '');
        $this->idx = $request->input('idx', 0);
        $this->limit = $request->input('limit', 0);
    }
}